 package nc.ui.mmpps.plo.action.maintain;
 
 import java.awt.event.ActionEvent;
import nc.ui.mmpps.plo.action.util.PoActionsUtil;
import nc.ui.mmpps.plo.model.PloManageAppModel;
import nc.ui.pubapp.uif2app.actions.DeleteAction;
import nc.util.mmf.framework.base.MMValueCheck;
import nc.vo.mmpps.mps0202.AggregatedPoVO;
import nc.vo.mmpps.mps0202.PoVO;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 public class PloDeleteAction
   extends DeleteAction
 {
   private static final long serialVersionUID = 1L;
   
	protected boolean isActionEnable() {
		Object[] selObjs = ((PloManageAppModel) getModel()).getSelectedOperaDatas();
		//add by zhoufla 20181008
		boolean unConfirm = true;
		if (selObjs != null && selObjs.length > 0) {
			PoVO[] allPoVOs = PoActionsUtil.convertObjects2PloVOs(selObjs);
			for (int i = 0; i < selObjs.length; i++) {
				PoVO poVO = allPoVOs[i];
				if (poVO.getFbillstatus() != 0) {
					unConfirm = false;
				}
			}
		}//end by zhoufla
		return PoActionsUtil.isEDActionEnable(selObjs)&&unConfirm;
	}
 
   public void doAction(ActionEvent arg0)
     throws Exception
   {
     Object[] objs = ((PloManageAppModel)getModel()).getSelectedOperaDatas();
     if (MMValueCheck.isEmpty(objs)) return;
     AggregatedPoVO[] aggs = PoActionsUtil.convertObj2AggVO(objs);
     PoVO[] ploVOs = PoActionsUtil.convertAggVO2PloVOs(aggs);
     if (MMValueCheck.isEmpty(ploVOs)) { return;
     }
     super.doAction(arg0);
   }
 }
